<!DOCtag html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <!--定义移动端缩放，比例变化-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新增标签</title>
    <!--css引入-->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
</head>
<body>
<!--添加分类页面-->

<!--nav:导航部分-->
<!--条:segment;黑色:inverted反转色-->
<nav class="ui attached segment  m-padded-tb-min m-shadow-small" style="background: #393D49;">
    <div class="ui container">
        <!--组件部分-->
        <div class="ui inverted secondary stackable menu fluid large">
            <!--3个标志部分-->
            <a href="/admin/index"><h1 class="ui teal header item">MBlog</h1></a>
            <a href="/admin/blogs_manage" class="item m-text-lfat m-mobile-hide" id="002"><i
                    class="home icon"></i>博客</a>
            <a href="/admin/types_manage" class="active item m-text-lfat m-mobile-hide" id="003"><i class="idea icon"></i>分类</a>
            <a href="/admin/tags_manage" class="item m-text-lfat m-mobile-hide" id="004"><i class="tags icon"></i>标签</a>
            <!--用户登录导航栏-->
            <div class="right menu m-mobile-hide item  m-padded-tb-min" id="005">
                <div class=" ui dropdown item">
                    <div class="text">
                        <img class="ui avatar image" src="/image/4.png" th:src="@{${session.user.avatar}}">
                        <span th:text="${session.user.username}">admin</span>
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="/admin/blogs_manage" class="item m-text-thin ">个人中心</a>
                        <a href="/logout" class="item m-text-thin ">退出登录</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu icon button m-right-top m-mobile-show" id="001" style="background: #393D49;">
        <div class="ui vertical animated button tiny">
            <div class="hidden content ">菜单</div>
            <div class="visible content ">
                <i class="sidebar icon"></i>
            </div>
        </div>
    </a>
</nav>
<!--二级导航:pointing:下面有个小箭头-->
<div class="ui container m-container-normal">
    <div class="ui  pointing menu m-margin-tb-medium">
        <div class="right menu">

            <a href="#" th:href="@{/admin/tags_manage}" class="item">列表</a>
            <a href="#" th:href="@{/admin/tags_manage/input}" class="active teal item">修改</a>
        </div>
    </div>
</div>

<!--中间查询内容-->
<div class="m-padded-tb-small">
    <div class="ui container  m-container-normal ">
        <h2 style="text-align: center;color: #393D49" class="ui block header m-text-spaced attached">
            新增标签
        </h2>

        <form action="#" th:action="@{/admin/tags_add}"  method="post" class="ui form segment m-padded-tb-min attached">

            <div class="required field"><!--required：表单校验添加-->
                <div class="ui left labeled input m-margin-tb-small ">
                    <!--标题输入框-->
                    <label class="ui teal label">类别名称</label>
                    <input type="text" name="name" placeholder="标签名称" >
                </div>
            </div>
            <!--存放表单校验的错误信息-->
            <div class="ui error message"></div>
            <!--按钮-->
            <div class="inline fields m-right">
                <!--返回按钮:没设置tag默认为提交表单-->
                <div class="field">
                    <button type="button" onclick="window.history.go(-1)"
                            class="ui grey small button m-margin-tb-small"><i
                            class="reply icon"></i>返回
                    </button>
                </div>

                <!--提交按钮-->
                <div class="field">
                    <button class="ui blue small submit button  m-margin-tb-small"><i
                            class="edit icon"></i>提交
                    </button>
                </div>
            </div>
        </form>

    </div>

</div>


<!--jquery引入-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<!--js引入-->
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

<!--js-->
<script>
    /*适应手机端*/
    $("#001").click(function () {
        $("#002").toggleClass('m-mobile-hide');
        $("#003").toggleClass('m-mobile-hide');
        $("#004").toggleClass('m-mobile-hide');
        $("#005").toggleClass('m-mobile-hide');
    });
    /*头像下拉*/
    $('.ui.dropdown').dropdown({});

    /*表单验证*/
    $('.ui.form').form({
        fields: {
            title: {
                identifier: 'name',
                rules: [{
                    type: 'empty',
                    prompt: '请输入分类名称'
                }]
            }
        }
    });

</script>
</body>
</html>